@import '../../../common/style/index.less';

@search-bg-color: var(--td-search-bg-color, @bg-color-secondarycontainer);
@search-text-color: var(--td-search-text-color, @font-gray-1);
@search-label-color: var(--search-label-color, @font-gray-1);
@search-font-size: var(--td-search-font-size, @font-size-m);
@search-height: var(--td-search-height, 80rpx);
@search-padding: var(--td-search-padding, 16rpx 24rpx);
@search-placeholder-color: var(--td-search-placeholder-color, @font-gray-3);
@search-icon-color: var(--td-search-icon-color, @font-gray-3);
@search-square-radius: var(--td-search-square-radius, @radius-default);
@search-round-radius: calc(@search-height / 2);
@search-action-color: var(--td-search-action-color, @brand-color);
@search-clear-icon-color: var(--td-search-clear-icon-color, @font-gray-3);

.@{prefix}-search {
  display: flex;
  justify-content: space-between;
  align-items: center;

  &__label {
    padding: 8rpx;
    color: @search-label-color;
  }

  &__input-box {
    flex: 1;
    box-sizing: border-box;
    display: flex;
    height: @search-height;
    align-items: center;
    border: 2rpx solid @search-bg-color;
    background: @search-bg-color;
    padding: @search-padding;

    &.@{prefix}-is-focused {
      border-color: @search-bg-color;
    }

    &--round {
      border-radius: @search-round-radius;
    }

    &--square {
      border-radius: @search-square-radius;
    }

    &--center {
      text-align: center;
    }

    .@{prefix}-input__keyword {
      display: inline-block;
      flex: 1;
      color: @search-text-color;
      font-size: @search-font-size;
      padding-left: 10rpx;
    }

    .@{prefix}-icon {
      color: @search-icon-color;
    }
  }

  &__clear {
    position: relative;
    margin-left: 10px;
    color: @search-clear-icon-color;
    .hotspot-expanded();
  }

  &__search-action {
    margin-left: 30rpx;
    font-size: @search-font-size;
    color: @search-action-color;
  }

  &__placeholder {
    color: @search-placeholder-color;

    &--center {
      text-align: center;
    }
  }
}
